﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Billing.CashDesk.CashDeskService;

namespace Billing.CashDesk
{
    public partial class ChooseClientForm : Form
    {
        private List<ClientInfo> clientsInfo;

        public List<ClientInfo> ClientsInfo
        {
            get
            {
                return clientsInfo;
            }
        }

        public ClientInfo SelectedDataObject
        {
            get
            {
                return clientInfoBindingSource.Current as ClientInfo;
            }
        }

        public ChooseClientForm()
        {
            InitializeComponent();
        }

        public void Initialize(List<ClientInfo> clientsInfo)
        {
            this.clientsInfo = clientsInfo;
            clientInfoBindingSource.DataSource = this.clientsInfo;
            clientInfoBindingSource.Position = -1;
        }

        private void clientInfoBindingSource_CurrentChanged(object sender, EventArgs e)
        {

        }

        private void valTax_ValueChanged(object sender, EventArgs e)
        {
            clientInfoBindingSource.Position = valTax.SelectedIndex;
        }
    }
}
